-
Notifications
You must be signed in to change notification settings - Fork 10
Update the configure logic #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Dima Dorezyuk <[email protected]>
Signed-off-by: Dima Dorezyuk <[email protected]>
7d4e408 to
a173fd5
Compare
hovinen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might need you to walk me through some of these changes, since I'm not so familiar with all of the components involved.
| } | ||
| constants::TerminalStatusCode::ReconciliationRequired => { | ||
| info!("Reconciliation required, running end of day"); | ||
| self.end_of_day().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We wouldn't know a failure occurred here, since end_of_day doesn't log failure. Do we want to add some failure log there, here, or log the error when calling configure? Same goes for failure of set_terminal_id, initialize, and run_diagnosis below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better yet - since if this function fails we won't have a working PT on a pole, better log it in the calling function and add an alert for this failure to track it
hovinen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM based on our discussion yesterday. Please see also my comments.
Signed-off-by: Dima Dorezyuk <[email protected]>
Signed-off-by: Dima Dorezyuk <[email protected]>
bfe2f3e to
b76ab59
Compare
Currently we run init and diagnostics on every start up - until the
successfully_configureflag is set. While being a simple logic this results in lots of unnecessary transactions (inti and diagnostics are transactions from the view of the payment provider backend and 1. cost money and 2. can overload the payment provider backend).The idea is to query the payment terminal (status inquiry, which is fast and does not result in calls to the payment provider backend) and based on the return code to reason if we need to run the aforementioned commands.
The status inquiry returns the terminal_status_code, which is defined under chapter 11 of zvt.